<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/11/7
 * Time: 4:06 PM
 */

namespace app\admin\controller;


use think\Request;

class Export extends Base
{
    /**
     * @purpose 导出保险
     * @param Request $request
     * @return \think\response\Download
     * @throws \PhpOffice\PhpSpreadsheet\Exception
     * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function insurance (Request $request)
    {
        $group_stage_id =   $request->get('group_stage_id', 0);
        return \app\admin\logic\Export::insurance($group_stage_id);
    }
    /**
     * @purpose 导出出行人
     * @param Request $request
     * @return \think\response\Download
     * @throws \PhpOffice\PhpSpreadsheet\Exception
     * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function travel (Request $request)
    {
        return \app\admin\logic\Export::travel($request->get('group_stage_id'));
    }

    /**
     * @purpose 导出分车信息
     * @param Request $request
     * @return \think\response\Download
     * @throws \PhpOffice\PhpSpreadsheet\Exception
     * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function pointsInTheCar (Request $request)
    {
        return \app\admin\logic\Export::pointsInTheCar($request->get('group_stage_id'));
    }
}